package com.realphim.app.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.realphim.app.FragmentFeature;
import com.realphim.app.util.MyCache;

public class AdapterFeaturePager extends FragmentPagerAdapter {

    public AdapterFeaturePager(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int arg0) {
        Fragment mFragment = new FragmentFeature();
        Bundle mBundle = new Bundle();
        mBundle.putInt("page", arg0);
        mFragment.setArguments(mBundle);
        return mFragment;
    }

    @Override
    public int getCount() {
        return MyCache.getInstance().listPhimFeature.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return "" + (position + 1);
    }

}
